-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: migrate from jest to vitest #518
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Joris Mancini <[email protected]>
Signed-off-by: Joris Mancini <[email protected]>
Signed-off-by: Joris Mancini <[email protected]>
Signed-off-by: Joris Mancini <[email protected]>
import react from '@vitejs/plugin-react'; | ||
|
||
export default defineConfig({ | ||
plugins: [react()], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we really need to redefine a vitestconfig file ?
"f you are using Vite and have a vite.config file, Vitest will read it to match with the plugins and setup as your Vite app. If you want to have a different configuration for testing [...] you could [...] create vitest.config.ts"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on other project, we set this directly on vite.config file with those parameters
test: { globals: true, environment: 'jsdom', setupFiles: './src/testSetup.ts', },
and the setup file, define a default config, like after afterEach(() => { cleanup() });
@@ -5,7 +5,10 @@ | |||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | |||
*/ | |||
|
|||
import { TextEncoder, TextDecoder } from 'util'; | |||
import { afterEach } from 'vitest'; | |||
import { cleanup } from '@testing-library/react'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there was already a PR to add @testing-library/react https://github.com/gridsuite/commons-ui/pull/216/files?w=1 it simplifies the code we should use it if we add testing-library
No description provided.